#include "client.h"

int tcp_cnd_init(const char *ip, int port)
{

    int cnd = socket(PF_INET, SOCK_STREAM, 0);
    ERROR_CHECK_FUN(-1, cnd);
    struct sockaddr_in caddr;
    caddr.sin_family = PF_INET;
    caddr.sin_port = htons(port);
    caddr.sin_addr.s_addr = inet_addr(ip);
    int ret = connect(cnd, (void *)&caddr, sizeof caddr);
    ERROR_CHECK_FUN(-1, ret);
    return cnd;
}
void user_log()
{
    char user_name[64];
    char user_passwd[64];
    while (1)
    {
        system("clear");
        printf("****************************************\n");
        printf("***********欢迎来到注册界面**************\n");
        printf("****************************************\n");
        printf("请输入账号");
        scanf("%s",user_name); 
        
    }
}
void user_reg();
void user_del();
void user_alt();
